{__NOLAYOUT__}
{include file="public/head"/}
{include file="public/header"/}
<div class="container-fluid main">
	<div class="row">
		<div class="col-xs-2 lefter">{include file="public/lefter"}</div>
		<div class="col-xs-10 righter" style="overflow-y:scroll ">
<a href="{:url('add')}" class="btn btn-info"><i class="fa fa-plus"></i>添加</a>
<table class="table">
	<thead>
		<th>名称</th>
		<th>操作</th>
	</thead>
	<tbody>
		{volist name="role" id="vo"}
			<tr>
				<td class="col-xs-10">{$vo.name}</td>
				<td class="col-xs-1"><a href="{:url('role/dodelete',['id'=>$vo.id])}" class="btn btn-warning btn-sm">删除</a></td>
				<td class="col-xs-1"><a  class="btn btn-warning btn-sm" onclick="edit('{$vo.id}');">修改</a></td>
			</tr>
		{/volist}
	</tbody>
</table>
<div class="text-center">{$role->render()}</div>
</div>
	</div>
</div>
<script>
	$(function(){
	});

	function edit(id){
		$.ajax({
			url:'edit' ,
		    type: 'post',
		    dataType: 'json',
		    data: {
		          "id":id
		    },
		    success: function(rel){
		    	$(".righter").append(rel.html);
		  //       console.log(rel);
		    },
		    error: function(){
		          
		    }
		});
	}
	 
</script>


{include file="public/footer"/}
{include file="public/foot"/}
